<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<!-- 在<head>部分添加以下标签 -->
		<meta name="mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<meta name="format-detection" content="telephone=no" />
		<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<!-- <link rel="stylesheet" href="pdf/style.css" /> -->
		<link rel="stylesheet" href="./pdf/index.css" />
		<link rel="stylesheet" href="pdf/pdfh5.css" />
		<style>
			html,
			body {
				width: 100vw;
				height: 100%;
			}

			.hide {
				opacity: 0;
			}
		</style>
	</head>
	<body>
		<div id="app" class="hide">
			<div class="navbox">
				<img @click="goBack" class="backBtn" src="http://cdn.yic3.cn/lawyer/mp-xhs/mine/backIcon.png" />
				<div>{{title}}</div>
			</div>
			<div id="pdf-view"></div>
			<div class="openResult" @click="hide = false">
				<img src="https://cdn.yic3.cn/lawyer/images/book.png" alt="" />
				<span>审查结果</span>
			</div>
			<div class="visableBox" :class="!hide?'visableShow':''" @click="hide = true">
			</div>
			<div class="resultBox" :class="!hide?'hiddenBox':''" @click.stop="" @touchmove="ontouchmove">
				<div class="resultTitle">
					<p>审查结果</p>
					<div @click="copy">
						<img src="https://cdn.yic3.cn/lawyer/images/copy.png" alt="" />
						<span>复制</span>
					</div>
				</div>
				<p class="resultContent" v-html="content"></p>
			</div>
		</div>
		<script src="pdf/pdf.js"></script>
		<script src="pdf/pdf.worker.js"></script>
		<script src="pdf/jquery-1.11.3.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="pdf/vue.min.js"></script>
		<script type="text/javascript" src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js">
		</script>
		<script src="pdf/pdfh5.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			new Vue({
				el: '#app',
				data() {
					return {
						title: '',
						content: '',
						hide: true,
						url: ''
					}
				},
				created() {
					const queryString = window.location.search.split('?')[1];
					const params = new URLSearchParams(queryString);
					this.content = params.get('content')
					this.url = params.get('url')
					this.title = params.get('title');
				},
				mounted() {
					document.querySelector('#app').classList.remove('hide')
					new Pdfh5('#pdf-view', {
						pdfurl: this.url,
						backTop: false,
						pageNum: false,
						background: {
							color: '#fff'
						},
						URIenable: true //开启浏览器地址栏file参数获取
					});
				},
				methods: {
					goBack() {
						uni.navigateBack()
					},
					copy() {
						uni.postMessage({
							data: {
								copy: true,
							}
						});
					},
					ontouchmove(e) {
						// console.log(JSON.stringify(e))
					}


				}
			})
		</script>
	</body>

</html>